$(document).ready( function(){
    $('.product_feature_0 .button_new_product').click( function(){
        $('.product_feature_0 .list_new_product').show();
        $('.product_feature_0 .list_best_seller').hide();
        $(this).removeClass('active');
        $('.product_feature_0 .button_best_seller').removeClass('active');
        $(this).addClass('active');
        return false;
    });
     	 	
    $('.product_feature_0 .button_best_seller').click( function(){
        $('.product_feature_0 .list_new_product').hide();
        $('.product_feature_0 .list_best_seller').show();
        $(this).removeClass('active');
        $('.product_feature_0 .button_new_product').removeClass('active');
        $(this).addClass('active');
        return false;
    });
    
    
    // item thu 3 cua list tren 1 dong thi add them class "last" de margin = 0
    $ ('.list_new_product .list_product div').each(function(i){
        var newClass = '';
       
        if ((i+1) % 3 == 0) {
            newClass = 'last';
        }
        $(this).addClass(newClass);
        

    });
    
     $ ('.list_best_seller .list_product div').each(function(i){
        var newClass = '';
       
        if ((i+1) % 3 == 0) {
            newClass = 'last';
        }
        $(this).addClass(newClass);
        

    });
});